Skip to content

refactor: modernize sync/atomic usage with typed atomic apis#511

Open
chuanshanjida wants to merge 1 commit intoethstorage:mainfrom
chuanshanjida:main
Open

refactor: modernize sync/atomic usage with typed atomic apis#511
chuanshanjida wants to merge 1 commit intoethstorage:mainfrom
chuanshanjida:main

Conversation

@chuanshanjida
Copy link
Copy Markdown

Replace legacy sync/atomic function-based API (AddInt32, LoadInt32, etc.)
with Go 1.19+ typed atomic types (atomic.Int32, atomic.Int64, etc.).

This change:

  • Improves code readability by removing explicit address-of operators
  • Enhances type safety at compile-time
  • Provides better API ergonomics with method-based access
  • Aligns with modern Go best practices (More info sync/atomic: add typed atomic values golang/go#50860)

Signed-off-by: chuanshanjida <chuanshanjida@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant